<template>
<!--    <uni-list>-->
<!--        <uni-list-item class="cu-item arrow" clickable v-for="storeMain in storeMainList" :key="storeMain.storeId" :title="storeMain.name"></uni-list-item>-->
<!--    </uni-list>-->
<div class="cu-list menu">
    <div class="cu-item arrow"  v-for="storeMain in storeMainList" :key="storeMain.storeId" @click="onClick(storeMain.storeId)">
        <text class="text-grey">{{storeMain.name}}</text>
    </div>
</div>
</template>

<script>
export default {
    data() {
        return {
            storeMainList:uni.getStorageSync("storeMainList"),
        }
    },
    methods:{
        onClick:function (storeId) {
            let index;
            for (index in this.storeMainList){
                if (this.storeMainList[index].storeId===storeId){
                    uni.setStorageSync("currentStoreMain",this.storeMainList[index])
                }
            }
            console.log(uni.getStorageSync("currentStoreMain"))
            uni.reLaunch({
                url:"/pages/home/index"
            })
        }
    }
}
</script>

<style scoped>

</style>